home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qbsnip.zip / FIREPRN.BAS < prev    next >
BASIC Source File  |  1997-06-20  |  2KB  |  54 lines

  1. DEFINT A-Z
  2. DECLARE SUB FirePrint (h%, v%, a$, tilt%)
  3.  
  4. ' Description : FirePrint! - Custom text print subroutine for
  5. '               VGA Mode 13
  6. ' Written by  : Andrew L. Ayers
  7. ' Date        : 07/24/96
  8. '
  9. ' This little routine allows you to place a "burning" text
  10. ' string on the mode 13 screen. This routine was based on
  11. ' a routine by Martin Lindhe. Both are essentially the same,
  12. ' though this one is cleaner. Remember, the better the machine,
  13. ' the better the effect. Also, smaller strings will look better.
  14. '
  15. ' You may use this routine in any manner you like, as long
  16. ' as you give Mr. Lindhe and myself credit in an appropriate
  17. ' manner.
  18. '
  19. ' I wish to thank Martin Lindhe for providing the inspiration
  20. ' to do this routine.
  21. '
  22.  
  23. SCREEN 13
  24.  
  25. 'This setup MUST go here, and not in the sub, to speed up "burning" effect!
  26. FOR t = 0 TO 63: PALETTE t, t: NEXT 'All Red
  27.  
  28. ' Call the routine once for a simple "flame" effect,
  29. ' or over and over (as done here) for a great "burning"
  30. ' effect! Use uppercase for best effect.
  31.  
  32. ' Note: This is not transparent text.
  33.  
  34. DO
  35.   CALL FirePrint(18, 12, "FIRE!", -1)
  36. LOOP UNTIL INKEY$ <> ""
  37.  
  38. PALETTE: SCREEN 0, 0, 0, 0: WIDTH 80: COLOR 7, 0: CLS : END
  39.  
  40. SUB FirePrint (h%, v%, a$, tilt%)
  41.  
  42. COLOR 63: LOCATE v%, h%: PRINT a$
  43. ' Set up start and end locations for the burn
  44. sx% = (h% * 8) - 8: ex% = ((h% + LEN(a$)) * 8) - 8
  45. sy% = (v% * 8) - 16: ey% = (v% * 8) - 8
  46. FOR y% = sy% TO ey%: FOR x% = sx% TO ex%
  47.   ' Take the current color, subtract a random amount for red flame "fade",
  48.   ' and plot the new point
  49.   col% = POINT(x%, y%) - RND * 25: IF col% < 0 THEN col% = 0
  50.   PSET (x% + tilt%, y% - 1), col%
  51. NEXT x%, y%
  52. END SUB
  53.  
  54.